package site.marqstree.kotlin.library.good.ui.activity.detail.tabs.tabspec

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.GridLayoutManager
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import kotlinx.android.synthetic.main.frag_good_detail_spec.*
import kotlinx.android.synthetic.main.fragment_good_list.*
import site.marqstree.kotlin.library.base.ui.fragment.BaseARouterFragment
import site.marqstree.kotlin.library.base.ui.widget.recyclerview.ImageAdapter
import site.marqstree.kotlin.library.good.R


/*
 * 项目名: KotlinMall
 * 包名: site.marqstree.kotlin.library.good.ui.activity.detail.tabs.tabspec
 * 文件名: FragGoodSpec
 * 创建者: marqstree
 * 创建时间: 2020/3/14 16:21
 * 描述: TODO
 */
@Route(path = "/good/fragment/goodspec")
class FragGoodSpec :BaseARouterFragment(){

    @Autowired
    @JvmField var mImages: List<String>? = null

    private val mAdapter: ImageAdapter by lazy{
        ImageAdapter(mImages!!.toMutableList())
    }

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        super.onCreateView(inflater, container, savedInstanceState)
        return inflater.inflate(R.layout.frag_good_detail_spec,null)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        val manager = GridLayoutManager(context,1)
        mRvGoodSpec.layoutManager=manager
        mRvGoodSpec.adapter = mAdapter
    }

}